package com.carl.selector;

import com.carl.annotation.WorldSelector;
import com.carl.config.WorldConfig;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.ImportSelector;
import org.springframework.core.type.AnnotationMetadata;

import java.util.Map;

@Configuration
public class WorldConfigSelector implements ImportSelector {

    @Override
    public String[] selectImports(AnnotationMetadata annotationMetadata) {
        Map<String, Object> map = annotationMetadata.getAnnotationAttributes(WorldSelector.class.getName());
        String[] importArray = new String[]{WorldConfig.class.getName()};//代表 selector-pick 的类
        System.out.println(" ###  selector --> " + map.get("selector") + " \n");
        System.out.println(" @ importArray : " + importArray + " \n");
        return importArray ;
    }

}

